﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LiuYanBan.aspx.cs" Inherits="ly.Web.QianTai.LiuYanBan" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>留言板</title>	
    <script src="js/jquery-2.1.1.min.js" type="text/javascript"></script>
        <script type="text/javascript">
            function InsertComment() {
                var name = $("#TextBox2").val();
                var content = $("#TextBox3").val();
                var time = new Date();

                $.post("InsertComment.ashx", { "name": name, "content": content, "time": time }, function (data, status) {
                    if (status == "success") {//服务器返回成功  
                        if (data == "success") {//添加成功  
                            var tr = $("<tr><td>昵称:" + name + "<br/>时间:" + time + "</td><td>内容:" + content + "</td></tr>");
                            $("#table1").append(tr); //把内容更新到页面  
                        }
                        else if (data == "error") {
                            alert("添加失败");
                        }
                        else {
                            alert("ajax error");
                        }
                    }
                    else {
                        alert("ajax error");
                    }
                });

            }  
    </script>

    <link href="css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=2.2.0" rel="stylesheet"
</head>
<body>
    <form id="form1" runat="server">
    <div>
    





                                      <div class="navbar-collapse collapse" id="navbar">
                                <ul class="nav navbar-top-links navbar-right">
                                    <li>
                                      <asp:Panel ID="pnlLogin" runat="server">
                                        <div class="login"> <a href="../Admin/Login.aspx">登录</a> <a href="register.aspx">|注册</a></div>
                                        </asp:Panel>
                                      <asp:Panel ID="pnlLoginOut" runat="server" Visible="false">
                                        <div class="login">
                                          <asp:Label ID="lblUserName" runat="server" Text="Label"></asp:Label>
                                          <a href="../Admin/Login.aspx">|退出</a></div>
                                        </asp:Panel>
                                    </li>
                        </ul>
                                          </div>
                <div id="main1">
            </div>
          

<%--                <asp:Repeater ID="rptDis" runat="server">
                <HeaderTemplate>
                    <table class="stripe_tb" border="1" width="60%" cellpadding="0" cellspacing="0">
                        <thead>
                            <tr class="nav_table">
                                <td bgcolor="#F5FAFE">用户名</td>

                                <td bgcolor="#F5FAFE">评论</td>
                            </tr>
                        </thead>
                        <tbody>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
<%--                        <td bgcolor="#ffffff">
                            <asp:CheckBox ID="chbqian" runat="server" /></td>
                        <td bgcolor="#ffffff">
                            <asp:Label ID="lblid" runat="server" Text='<%#Eval("UserName")%>'></asp:Label></td>--%>
                        <td bgcolor="#ffffff"><%#Eval("UserName")%></td>
                        <td bgcolor="#ffffff"><%#Eval("CommentContent")%></td>
                        <%--<td bgcolor="#ffffff"><%#Eval("WorkPicture")%></td>--%>
                        </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </tbody>

                        </table>
                </FooterTemplate>
                        </asp:Repeater>


                <asp:DataList ID="rptDiss" runat="server" RepeatColumns="4" BorderStyle="None"
                                                    CellSpacing="2" Width="100%" 
                               RepeatDirection="Horizontal">
                          <ItemTemplate>
                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="wrapper wrapper-content animated fadeInUp">
                                        <ul class="notes">
                                            <li>
                                <div>
                                    <small><%#Eval("CommentTime")%></small>
                                    <h4><%#Eval("UserName")%></h4>
                                    <p><%#Eval("CommentContent")%></p>
                                    <a href="pin_board.html#"><i class="fa fa-trash-o "></i></a>
                                </div>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            </li>
                          </ItemTemplate>
                        </asp:DataList>

                        <h2>新建留言：</h2>
             <asp:TextBox ID="txt1" runat="server" TextMode="MultiLine"></asp:TextBox> 
            <asp:Button ID="Button2" runat="server" Text="提交留言" onclick="Button2_Click" />



    </div>
    </form>
</body>
</html>
